package com.zf.minio.exception;

import com.zf.common.core.result.ResultCodeEnum;

/**
 * @author Zhou Feng
 */
public class BusinessException extends RuntimeException {
    private String code;

    private String msg;

    public BusinessException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMsg());
        this.code = resultCodeEnum.getCode();
        this.msg = resultCodeEnum.getMsg();
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = ResultCodeEnum.FAILURE.getCode();
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
